--[[

LibDataBroker details.

]]

LBTBroker = LibStub:GetLibrary("LibDataBroker-1.1"):NewDataObject(LBT_ID, {
	-- Setting this to "data source" allows Titan to display the addon text properly, and sets various other functions as expected.
	type	= "data source",

	-- Set this to the name of the addon, Titan Panel gets picky, this is the NAME of the addon for it.
	label	= LBT_DESC,
	text	= LBT_DESC,

	-- Left Click	- Select the next totalable bag
	-- Right Click	- Toggle Display of the Bag Name
	OnClick = function(_, msg)
		if msg == "LeftButton" then
			-- Select the next bag
			LBT_SelectNextBag();

		elseif msg == "RightButton" then
			-- Toggle the bag name
			if (LBT_Config.DisplayBagName == true) then
				LBT_Config.DisplayBagName = false;
			else
				LBT_Config.DisplayBagName = true;
			end
			
			-- Update the Button
			LBT_OnEvent();
		end
	end,

	-- Use the blizzard "bag" icon
	icon	= "Interface\\Icons\\inv_misc_bag_27",

	OnTooltipShow = function(tooltip)
		if not tooltip or not tooltip.AddLine then
			return;
		end
		LBT_SetTooltip(tooltip);
	end,
});
